package com.ph.permission.api.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ph.base.BaseController;
import com.ph.shopping.common.util.result.Result;
import com.ph.shopping.facade.permission.service.IMenuService;

@Controller
@RestController
@RequestMapping(value="api/menu")
public class MenuController extends BaseController{
	
	@Reference(version="1.0.0")
	private IMenuService menuService;
	
	/**
	 * @根据用户Id获取菜单
	 * @param userId
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	public Object getMemberList(@RequestParam(value="userId",required=true)Long userId){
		Result result=menuService.getMenuByUserId(userId);
		return result;
	}
	
	/**
	 * @获取所有菜单
	 * @return
	 */
	@RequestMapping(value="/list/all",method=RequestMethod.GET)
	public Object getAllMenu(){
		return menuService.getAllMenu();
	}
}
